<?php

Class Zhishidi_Dailydeals_Model_Settings {
    const XML_DAILY_DEALS_SETTINGS_PATH = "zhishidi_dailydeals_info/settings/";

    public function getPageTitle() {
        return Mage::getStoreConfig(self::XML_DAILY_DEALS_SETTINGS_PATH . 'page_title');
    }

    public function getSidebarTitle() {
        return Mage::getStoreConfig(self::XML_DAILY_DEALS_SETTINGS_PATH . 'sidebar_title');
    }

    public function getMaxCount() {
        return Mage::getStoreConfig(self::XML_DAILY_DEALS_SETTINGS_PATH . 'max_count');
    }

    public function getCookiesPrefix($salt = "") {
        if ($salt) {
            $salt = Mage::getModel('core/encryption')->hash($salt . Mage::getStoreConfig(self::XML_DAILY_DEALS_SETTINGS_PATH . 'cookie_salt')) ;
            return Mage::getStoreConfig(self::XML_DAILY_DEALS_SETTINGS_PATH . 'cookie_prefix').$salt;
        }
        return Mage::getStoreConfig(self::XML_DAILY_DEALS_SETTINGS_PATH . 'cookie_prefix');
    }

    public function getCookiesTtl() {
        return Mage::getStoreConfig(self::XML_DAILY_DEALS_SETTINGS_PATH . 'cookie_ttl');
    }

    public function isEnabled() {
        return Mage::getStoreConfig(self::XML_DAILY_DEALS_SETTINGS_PATH . 'enable');
    }

    public function isCookiesEnabled() {
        return Mage::getStoreConfig(self::XML_DAILY_DEALS_SETTINGS_PATH . 'cookie_enable');
    }

}

